import { Tools } from 'weaver-mobile';
import DocConstant from '../util/index';
const catchApiError = DocConstant.catchApiError;
// 我的云盘列表
export const getMyList = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/getDataList', method: 'GET', params}).then(catchApiError);
//我的分享列表
export const getMyShareList = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/getMyShareList', method: 'GET', params}).then(catchApiError);
//同事的分享列表
export const getWorkmateShareList = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/getShareMyList', method: 'GET', params}).then(catchApiError);
    // 我的云盘目录树
export const getMyTree = params =>
    Tools.callApi({url: '/api/networkdisk/mytree', method: 'GET', params}).then(catchApiError);
// 知识目录树
export const getDocTree = params =>
    Tools.callApi({url: '/api/networkdisk/doc/tree', method: 'GET', params}).then(catchApiError);
// 我的分享列表
export const getMyShare = params =>
    Tools.callApi({url: '/api/networkdisk/sharelist/my', method: 'GET', params}).then(catchApiError);
// 同事的分享列表
export const getWorkmateShare = params =>
    Tools.callApi({url: '/api/networkdisk/sharelist/workmate', method: 'GET', params}).then(catchApiError);
// 发布
export const publish = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/publish', method: 'POST', params}).then(catchApiError);
// 删除
export const del = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/delete', method: 'GET', params}).then(catchApiError);
// 移动
export const move = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/move', method: 'POST', params}).then(catchApiError);
// 上传
export const uploadToCloudDisk = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/uploadToCloudDisk', method: 'POST', params}).then(catchApiError);
// 保存目录
export const saveCategory = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/createFolder', method: 'GET', params}).then(catchApiError);
// 保存到我的云盘
export const saveToMy = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/save2Disk', method: 'POST', params}).then(catchApiError);
// 分享
export const share = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/share', method: 'POST', params}).then(catchApiError);
// 取消分享
export const cancelShare = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/cancelShare', method: 'POST', params}).then(catchApiError);
// 查看分享对象
export const getShareWithList = params =>
    Tools.callApi({url: '/api/networkdisk/clouddisk/getShareObj', method: 'GET', params}).then(catchApiError);
// 删除分享对象
export const deleteShareObj = params => Tools.callApi({url: '/api/networkdisk/clouddisk/deleteShareObj', method: 'GET', params}).then(catchApiError);
// 重命名
export const rename = params => Tools.callApi({url: '/api/networkdisk/clouddisk/rename', method: 'GET', params}).then(catchApiError);
// 获得云盘信息
export const getInfo = params => Tools.callApi({url: '/api/networkdisk/clouddisk/diskInfo', method: 'GET', params}).then(catchApiError);
//判断查看云盘文件/目录的权限
export const checkShare = params => Tools.callApi({url: '/api/networkdisk/clouddisk/checkShare', method: 'GET', params}).then(catchApiError);
//上传文件白名单
export const getwhietlist = params => Tools.callApi({url: '/api/doc/console/netdiskset/whitelist', method: 'GET', params});
